<?php


namespace App\Goods;

use Illuminate\Support\Facades\Route;
use Illuminate\Support\ServiceProvider;

/**
 * 商品中心
 * Class GoodsServiceProvider
 * @package App\Goods
 */
class GoodsServiceProvider extends ServiceProvider
{
    /**
     * 注册
     */
    public function register()
    {
        $this->registerRoute();
    }


    /**
     * 注册路由
     */
    public function registerRoute()
    {
        Route::prefix('goods')
            ->middleware(['api'])
            ->namespace('App\Goods\Http\Controller')
            ->group(function () {
                $files = glob(app_path("Goods/Routes") . '/*.php');
                foreach ($files as $file) {
                    require $file;
                }
            });
    }
}
